home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / dev / www_talk.930 / 000799_dsr@hplb.hpl.hp.com _Wed Mar 31 13:45:39 1993.msg < prev    next >
Internet Message Format  |  1994-01-24  |  6KB

  1. Return-Path: <dsr@hplb.hpl.hp.com>
  2. Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
  3.     id AA09692; Wed, 31 Mar 93 13:45:39 MET DST
  4. Received: from hplb.hpl.hp.com by dxmint.cern.ch (5.65/DEC-Ultrix/4.3)
  5.     id AA27182; Wed, 31 Mar 1993 14:04:25 +0200
  6. Received: from dragget.hpl.hp.com by hplb.hpl.hp.com; Wed, 31 Mar 93 12:58:50 +0100
  7. Received: by manuel.hpl.hp.com
  8.     (16.6/15.6+ISC) id AA22020; Wed, 31 Mar 93 13:05:30 +0100
  9. From: Dave_Raggett <dsr@hplb.hpl.hp.com>
  10. Message-Id: <9303311205.AA22020@manuel.hpl.hp.com>
  11. Subject:  Re: Tabular environment in HTML
  12. To: www-talk@nxoc01.cern.ch
  13. Date: Wed, 31 Mar 93 13:05:28 BST
  14. Mailer: Elm [revision: 66.36.1.1]
  15.  
  16. > Tabular work is, accordingto the experts, a can of worms.
  17. > However, it is important.  It is definitely not in HTML,
  18. > but a good discussion is definitively in order.
  19. > Tables in practice need all kinds of things
  20. > (joined cells, break lines, etc)  A lot of work has been done,
  21. > it needs to be brought together and written up.
  22.  
  23. > Pointers, anyone?
  24.  
  25. > Tim
  26.  
  27. I have looked at Latex, tbl and Microsoft Word, and come up with a
  28. rich yet easy scheme for augmenting HTML. Please look through
  29. and voice your comments!
  30.  
  31. tbl is simple except when you want multi-line text which gets tedious
  32. as you are forced to specify the line breaks explicitly. This can be
  33. circumvented with a simple extension. The style of tbl leads to lots of
  34. tabs for padding over empty cells. This comes from not being able to
  35. say that a given cell should be further subdivided. It has a nice
  36. feature for aligning numeric values, missing from Latex.
  37.  
  38. Latex's tablular environments are ok, but get messy for fields extending
  39. across multiple columns.
  40.  
  41. Microsoft Word allows you to first specify the number of rows and columns
  42. and then alter them, e.g. merging or splitting adjacent cells.
  43.  
  44.  
  45. Here is my suggestion for a general scheme for specifying tables
  46. which uses just three tags and IMHO is simpler than the above:
  47.  
  48. The following example from Lamport's Latex manual should make all this clear:
  49.  
  50.     -------------------------------------------------
  51.     |    CG&A Hoofed Stock                          |
  52.     |===============================================|
  53.     |      ||    Price    |                         |
  54.     |      ||-------------|                         |
  55.     | Year ||  low | high |     Comments            |
  56.     |-----------------------------------------------|
  57.     | 1971 ||    97-245   | Bad year for farmers    |
  58.     |      ||             | in the west.            |
  59.     |-----------------------------------------------|
  60.     |   72 ||   245-245   | Light trading due to a  |
  61.     |      ||             | bad winter.             |
  62.     |-----------------------------------------------|
  63.     |   73 ||   245-2001  | No gnus was very good   |
  64.     |      ||             | gnus this year.         |
  65.     -------------------------------------------------
  66.  
  67.     <table>
  68.         <line>
  69.         <row cols="c">
  70.         CG&A Hoofed Stock
  71.         <line>
  72.         <line>
  73.         <row cols="|cb||c|cb|">
  74.         Year <t>
  75.         <table>
  76.             <row cols="c">
  77.             Price
  78.             <line>
  79.             <row cols="r|l">
  80.             low <t> high
  81.         </table>
  82.         Comments
  83.         <row cols="nnl20">
  84.         1971 <t> 97-245 <t> Bad year for farmers in the west. <t>
  85.         72 <t> 245-245 <t> Light trading due to a heavy winter.
  86.         73 <t> 245-2001 <t> No gnus was very good gnus this year.
  87.     </table>
  88.  
  89. Tables are specified by the <table> ... </table> tag.
  90.  
  91. You specify a format for the current row. This continues until a new
  92. specification is given:
  93.  
  94.     <row cols=FORMAT> where the FORMAT is a string formed from:
  95.  
  96.     l       left aligned column
  97.     r       right aligned column
  98.     c       centered column
  99.     n       numeric aligned column (on units or decimal point)
  100.  
  101.     t       align this cells contents at the top of the row
  102.     b       align this cells contents at the bottom of the row
  103.  
  104.     |       a vertical line extending the height of this row only
  105.             this is repeated for mutiple lines
  106.  
  107. The vertical alignment is an optional suffix following l,r,c,n.
  108. An optional width can be given as an integer following l, r, c
  109. (after t or b if present) to indicate the desired width of the column
  110. in characters (av.char width), e.g. "lt40"
  111.  
  112. Numerically aligned fields will be nominally centered, but adjusted so
  113. that the units digits line up (or the decimal point). You can also
  114. specify more that one number, e.g. nnn-nnn, in which case the browser
  115. may be able to line up the "-" chars, or failing that to simply centering
  116. the text. (Should we make "-" an optional format character, e.g. "n-n" ?)
  117.  
  118. The text for each cell is separated by a tag e.g. <t> rather than the
  119. tab character as used by tbl.
  120.  
  121. The <line> tag ends the current row and draws a line extending across the full
  122. extent of this table. Any missing cell values are padded with blanks.
  123.  
  124. You can nest <table> tags to split a given cell into smaller ones. The width
  125. and height of the nested table then effects the size of the row and column
  126. of the parent table, into which it is inserted.
  127.  
  128. All rows in a given table have the same width. The width of each cell is
  129. determined by the cell containing the largest value for the corresponding
  130. row and column.
  131.  
  132. It may be advisable to require all <row> tags in a table to specify the
  133. same number of columns. In this case you then need an "s" format character
  134. to indicate a spanned column, i.e. merged with the preceding one.
  135.  
  136.  
  137. Dave Raggett
  138.  
  139. HPLabs, Bristol, UK
  140.  
  141. +44 272 228046
  142. dsr@hplb.hpl.hp.com